package com.ioftv.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ioftv.entity.LabelerTaskPackage;
import com.ioftv.mapper.LabelerTaskPackageMapper;
import com.ioftv.service.LabelerTaskPackageService;
import com.ioftv.service.base.BaseService;
import org.springframework.stereotype.Service;

/**
 * 标注员任务包服务实现类
 */
@Service
public class LabelerTaskPackageServiceImpl extends BaseService<LabelerTaskPackageMapper, LabelerTaskPackage> implements LabelerTaskPackageService {

    @Override
    protected void addUserCondition(LambdaQueryWrapper<LabelerTaskPackage> queryWrapper) {
        queryWrapper.eq(LabelerTaskPackage::getUserId, getCurrentUserId());
    }

    @Override
    protected void setEntityUserId(LabelerTaskPackage entity) {
        if (entity.getUserId() == null) {
            entity.setUserId(getCurrentUserId());
        }
    }
}